<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>克隆节点：cloneNode</title>
		<style>
			.alert {
				padding: 15px;
				border: 1px solid #d6e9c6;
				border-radius: 4px;
				color: #3c763d;
				background-color: #dff0d8;
			}
		</style>
	</head>
	<body>
		<div class="alert" id="div"><strong>Hi there!</strong> You've read an important message.</div>

		<script>
			let div2 = div.cloneNode(true) // 克隆消息
			div2.querySelector('strong').innerHTML = 'Bye there!' // 修改克隆

			div.after(div2) // 在已有的 div 后显示克隆
		</script>
	</body>
</html>
